package com.itheima.tliasmanager.mapper;


import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.tliasmanager.pojo.domain.Emp;
import com.itheima.tliasmanager.pojo.dto.GenderCount;
import com.itheima.tliasmanager.pojo.dto.JobCount;
import com.itheima.tliasmanager.pojo.dto.QueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmpMapper   extends  BaseMapper<Emp> {

    /**
     * 自定义SQL+配置MP条件构建器：批量更新
     */
    void updateAddSalaryByIds(@Param("money") double money , @Param("ew") LambdaUpdateWrapper<Emp> wrapper);


    /**
     * 统计每个职位的个数
     * @return
     */
    //@Select("select job , count(*) count from emp  where job is not null group by  job")
    List<JobCount> countByJob();

    /**
     * 统计性别人数
     * @return
     */
    List<GenderCount> countByGender();

}




















